<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<title>安装 ICU 插件 | Elasticsearch: 权威指南 | Elastic</title>
    <!-- Give IE8 a fighting chance -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
	<link rel="stylesheet" type="text/css" href="../static/styles.css" />
</head>
<body>
<div class="main-container">
    <section id="content">
        
        <div class="content-wrapper">
            <section id="guide" lang="zh_cn">
                <div class="container">
                    <div class="row">
                        <div class="col-xs-12 col-sm-8 col-md-8 guide-section">
                            <div style="color:gray; word-break: break-all; font-size:12px;">原文地址: <a href="https://www.elastic.co/guide/cn/elasticsearch/guide/current/icu-plugin.html" rel="nofollow">https://www.elastic.co/guide/cn/elasticsearch/guide/current/icu-plugin.html</a>, 版权归 www.elastic.co 所有<br/>
                            英文版地址: <a href="https://www.elastic.co/guide/en/elasticsearch/guide/current/icu-plugin.html" rel="nofollow">https://www.elastic.co/guide/en/elasticsearch/guide/current/icu-plugin.html</a>
                            </div>
                        <!-- start body -->
                  <div class="page_header">
<b>请注意:</b><br>本书基于 Elasticsearch 2.x 版本，有些内容可能已经过时。
</div>
<div id="content">
<div class="breadcrumbs">
<span class="breadcrumb-link"><a href="index.html">Elasticsearch: 权威指南</a></span>
»
<span class="breadcrumb-link"><a href="languages.html">处理人类语言</a></span>
»
<span class="breadcrumb-link"><a href="identifying-words.html">词汇识别</a></span>
»
<span class="breadcrumb-node">安装 ICU 插件</span>
</div>
<div class="navheader">
<span class="prev">
<a href="standard-tokenizer.html">« 标准分词器</a>
</span>
<span class="next">
<a href="icu-tokenizer.html">icu_分词器 »</a>
</span>
</div>
<div class="section">
<div class="titlepage"><div><div>
<h2 class="title">
<a id="icu-plugin"></a>安装 ICU 插件<a class="edit_me edit_me_private" rel="nofollow" title="Editing on GitHub is available to Elastic" href="https://github.com/elasticsearch-cn/elasticsearch-definitive-guide/edit/cn/210_Identifying_words/30_ICU_plugin.asciidoc">edit</a>
</h2>
</div></div></div>
<p>Elasticsearch的 <a href="https://github.com/elasticsearch/elasticsearch-analysis-icu" class="ulink" target="_top">ICU 分析器插件</a> 使用 <em>国际化组件 Unicode</em> (ICU) 函数库（详情查看 <a href="http://site.icu-project.org" class="ulink" target="_top">site.project.org</a> ）提供丰富的处理 Unicode 工具。
这些包含对处理亚洲语言特别有用的 <code class="literal">icu_分词器</code> ，还有大量对除英语外其他语言进行正确匹配和排序所必须的分词过滤器。</p>
<div class="note admon">
<div class="icon"></div>
<div class="admon_content">
<p>ICU 插件是处理英语之外语言的必需工具，非常推荐你安装并使用它，不幸的是，因为是基于额外的 ICU 函数库，
不同版本的ICU插件可能并不兼容之前的版本，当更新插件的时候，你需要重新索引你的数据。</p>
</div>
</div>
<p>安装这个插件，第一步先关掉你的Elasticsearch节点，然后在Elasticsearch的主目录运行以下命令：</p>
<div class="pre_wrapper lang-sh">
<pre class="programlisting prettyprint lang-sh">./bin/plugin -install elasticsearch/elasticsearch-analysis-icu/$VERSION <a id="CO136-1"></a><i class="conum" data-value="1"></i></pre>
</div>
<div class="calloutlist">
<table border="0" summary="Callout list">
<tr>
<td align="left" valign="top" width="5%">
<p><a href="#CO136-1"><i class="conum" data-value="1"></i></a></p>
</td>
<td align="left" valign="top">
<p>当前 <code class="literal">$VERSION</code> （版本）可以在以下地址找到
<em><a href="https://github.com/elasticsearch/elasticsearch-analysis-icu" class="ulink" target="_top">https://github.com/elasticsearch/elasticsearch-analysis-icu</a></em>.</p>
</td>
</tr>
</table>
</div>
<p>一旦安装后，重启Elasticsearch，你将会看到类似如下的一条启动日志：</p>
<pre class="literallayout">[INFO][plugins] [Mysterio] loaded [marvel, analysis-icu], sites [marvel]</pre>

<p>如果你有很多节点并以集群方式运行的，你需要在集群的每个节点都安装这个插件。</p>
</div>
<div class="navfooter">
<span class="prev">
<a href="standard-tokenizer.html">« 标准分词器</a>
</span>
<span class="next">
<a href="icu-tokenizer.html">icu_分词器 »</a>
</span>
</div>
</div>

                  <!-- end body -->
                        </div>
                        <div class="col-xs-12 col-sm-4 col-md-4" id="right_col">
                        
                        </div>
                    </div>
                </div>
            </section>
        </div>
    </section>
</div>
<script src="../static/cn.js"></script>
</body>
</html>